<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="app" uri="http://www.wanrenhui.com"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@include file="/res/include/base-head.jsp"%>
<%@include file="/res/include/jquery-easyui.jsp"%>
<script type="text/javascript" src="${pageContext.request.contextPath}/res/js/delivery/order.js"></script>
<style>
*{margin:0; padding:0;}
.box{ position:absolute; padding:10px 20px 20px 20px; background:#fff; z-index:999999;}
.box dl{display:block; width:100%;margin-bottom:50px;}
.box dt{font-size:14px;color:red;line-height:30px; font-weight:bold;}
.box dd{ width:49%;float:left; line-height:30px; }

table.gridtable {
	font-family: verdana,arial,sans-serif;
	font-size:11px;
	color:#333333;
	border-width: 1px;
	border-color: #666666;
	border-collapse: collapse;
}
table.gridtable th {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #666666;
	background-color: #dedede;
}
table.gridtable td {
	border-width: 1px;
	padding: 8px;
	border-style: solid;
	border-color: #666666;
	background-color: #ffffff;
}
</style>
</head>
<body>
	<div class="box">
		<dl>
			<dt>订单</dt>
			<dd>
				订单号：<c:out value='${order.orderNo}' />
			</dd>
			<dd>
				下单时间：<c:out value='${order.strNewAt}' />
			</dd>
			<dd>
				订单名称：<c:out value='${order.title}' />
			</dd>
			<dd>
				订单总额：<c:out value='${order.total}' />
			</dd>
			<dd>
				支付状态：
				<c:choose>
					<c:when test="${order.payStatus==1}">未付款</c:when>
					<c:when test="${order.payStatus==2}">已付款</c:when>
					<c:when test="${order.payStatus==3}">退款中</c:when>
					<c:otherwise>已退款 </c:otherwise>
				</c:choose>
			</dd>
			<dd>
				支付状态时间：<c:out value='${order.strPayStatusAt}' />
			</dd>
			<dd>
				入库状态：
				<c:choose>
					<c:when test="${deliveryOrder.status==1}">待入库</c:when>
					<c:when test="${deliveryOrder.status==2}">待签收</c:when>
					<c:when test="${deliveryOrder.status==3}">已签收</c:when>
				</c:choose>
			</dd>
			<dd>
				入库状态时间：<c:out value='${deliveryOrder.strStatusAt}' />
			</dd>
			<dd>
				订单状态：
				<c:choose>
					<c:when test="${order.orderStatus==1}">未完成</c:when>
					<c:when test="${order.orderStatus==2}">已完成</c:when>
					<c:when test="${order.orderStatus==3}">已取消</c:when>
					<c:otherwise>已删除</c:otherwise>
				</c:choose>
			</dd>
			<dd>
				订单状态时间：<c:out value='${order.strOrderStatusAt}' />
			</dd>
			<dd>
				买家：<c:out value='${buyer.nick}' />
			</dd>
		</dl>
		<dl>
			<dt>代送地址</dt>
			<dd>收货人：<c:out value='${delivery.consignee}' /></dd>
			<dd>联系电话：<c:out value='${delivery.phone}' /></dd>
			<dd>收货地址：<c:out value='${delivery.address}' /></dd>
		</dl>
		<dl>
			<dt>物流信息</dt>
			<dd>物流公司：<c:out value='${deliveryOrder.deliveryName}' /></dd>
			<dd>物流公司：<c:out value='${deliveryOrder.deliveryNo}' /></dd>
			<dd id="kuaidi"></dd>
		</dl>
		<c:if test="${deliveryOrder.status==1}">
		 	<p class="page_btn">
		    	<input type="button" value="入库" class="btn_blue" onclick="admin.deliveryOrder.inStorage(${deliveryOrder.id});"/>
		    </p>
		 </c:if>
	</div>
</body>
</html>
<script type="text/javascript">
	getKuaidi('${deliveryOrder.deliveryName}','${deliveryOrder.deliveryNo}');
	function getKuaidi(deliveryName, deliveryNo) {
		var url = contextPath+'/delivery/order/kuaidi';
		var data = {"deliveryName":deliveryName,"deliveryNo":deliveryNo};
		$.post(url,data,function(result) {
			if(result.code==1) {
				$("#kuaidi").html(result.map.content);
			} else {
				top.showInfo('获取物流信息失败:'+result.msg);
			}
		},'json');
	}
</script>